Fetch the OVMF repository from specific git mirror and enable it
authorAttilio Rao <attilio.rao@citrix.com>
Thu, 22 Mar 2012 10:26:03 +0000 (10:26 +0000)
committerAttilio Rao <attilio.rao@citrix.com>
Thu, 22 Mar 2012 10:26:03 +0000 (10:26 +0000)
Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
.hgignore
Config.mk
tools/firmware/Makefile
tools/firmware/ovmf-makefile [new file with mode: 0644]

index cd433ba3b2d286518378636413703ca7a50524b2..2764b69af35839cbd57520014370260eefc9d960 100644 (file)
--- a/.hgignore
+++ b/.hgignore
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
+^tools/firmware/ovmf-remote
+^tools/firmware/ovmf$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
index 34ad0eaa117a4a0b7163fffa87b91008cf9b44f5..ec5485882f0a00fac4920642d9f554ff3c9e12de 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -191,12 +191,15 @@ QEMU_REMOTE=git://xenbits.xensource.com/qemu-xen-unstable.git
 endif
 
 ifeq ($(GIT_HTTP),y)
+OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
+OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
+OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
@@ -204,7 +207,7 @@ SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= n
+CONFIG_OVMF ?= $(CONFIG_Linux)
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 
index 696c7afc67ce69b2b371c7119e5f92a6b51c99ac..bfef1ab5b3a14e3e3b753dd7f1b2a1fa0a39df1b 100644 (file)
@@ -6,12 +6,17 @@ TARGET      := hvmloader/hvmloader
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
+SUBDIRS-$(CONFIG_OVMF) += ovmf
 SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
 SUBDIRS-$(CONFIG_ROMBIOS) += rombios
 SUBDIRS-$(CONFIG_ROMBIOS) += vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
 SUBDIRS-y += hvmloader
 
+ovmf:
+       GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf
+       cp ovmf-makefile ovmf/Makefile;
+
 seabios-dir:
        GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
        cp seabios-config seabios-dir/.config;
@@ -44,9 +49,35 @@ distclean: subdirs-distclean
 subdir-distclean-etherboot: .phony
        $(MAKE) -C etherboot distclean
 
+subdir-distclean-ovmf: .phony
+       rm -rf ovmf ovmf-remote
+
 subdir-distclean-seabios-dir: .phony
        rm -rf seabios-dir seabios-dir-remote
 
+.PHONY: ovmf-find
+ovmf-find:
+       if test -d $(OVMF_UPSTREAM_URL) ; then \
+                      mkdir -p ovmf; \
+        else \
+                export GIT=$(GIT); \
+                $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf ; \
+        fi
+
+.PHONY: ovmf-force-update
+ovmf-force-update:
+       set -ex; \
+       if [ "$(OVMF_UPSTREAM_REVISION)" ]; then \
+               cd ovmf-remote; \
+               $(GIT) fetch origin; \
+               $(GIT) reset --hard $(OVMF_UPSTREAM_REVISION); \
+       fi
+
+subdir-clean-ovmf:
+       set -e; if test -d ovmf/.; then \
+               $(MAKE) -C ovmf clean; \
+       fi
+
 .PHONY: seabios-dir-force-update
 seabios-dir-force-update:
        set -ex; \
diff --git a/tools/firmware/ovmf-makefile b/tools/firmware/ovmf-makefile
new file mode 100644 (file)
index 0000000..c3cd466
--- /dev/null
@@ -0,0 +1,17 @@
+# OVMF building system is not ready yet to run in parallel.
+# Force it to be serial in order to exploit parallelism for neighbors.
+
+.NOTPARALLEL:
+MAKEFLAGS  += -j1
+
+.PHONY: all
+all: ovmf.bin
+
+.PHONY: ovmf.bin
+ovmf.bin:
+       OvmfPkg/build.sh -a X64
+       cp Build/OvmfX64/DEBUG_GCC44/FV/OVMF.fd ovmf.bin
+
+.PHONY: clean
+clean:
+       rm -rf ovmf.bin Build/*